gtk4.git
11 years agoGtkImage: Drop use of GtkMisc::x/yalign
Matthias Clasen [Fri, 23 May 2014 02:51:00 +0000 (22:51 -0400)]
GtkImage: Drop use of GtkMisc::x/yalign

Instead, use GtkWidget::h/valign to position the image inside
the allocation. And just stop using GtkMisc::x/ypad.

https://bugzilla.gnome.org/show_bug.cgi?id=730613

11 years agoGtkLabel: Drop use of GtkMisc::x/yalign
Matthias Clasen [Fri, 23 May 2014 01:19:49 +0000 (21:19 -0400)]
GtkLabel: Drop use of GtkMisc::x/yalign

Instead, use GtkWidget::h/valign to position the text inside
the allocation. And just stop using GtkMisc::x/ypad.

https://bugzilla.gnome.org/show_bug.cgi?id=730613

11 years agoFix filechooser actionbar visibility
Matthias Clasen [Sat, 24 May 2014 04:00:00 +0000 (00:00 -0400)]
Fix filechooser actionbar visibility

The actionbar was always visible, even when there is no filter
and no extra widget to show. Now we only show it when there is
something to show.

11 years agoinspector: Treat resources the same as in gtk/
Matthias Clasen [Sat, 24 May 2014 03:00:43 +0000 (23:00 -0400)]
inspector: Treat resources the same as in gtk/

11 years agoAdd two more icon names to check
Matthias Clasen [Sat, 24 May 2014 02:59:22 +0000 (22:59 -0400)]
Add two more icon names to check

These were found in the trash monitor.

11 years agoDrop no-longer-used gtkrc files
Matthias Clasen [Sat, 24 May 2014 02:00:51 +0000 (22:00 -0400)]
Drop no-longer-used gtkrc files

These were replaced by css files long ago.

11 years agoDrop a pointless function
Matthias Clasen [Sat, 24 May 2014 01:56:44 +0000 (21:56 -0400)]
Drop a pointless function

No need to have a finalize function if it just chains
up to the parent class.

11 years agoTrivial: slight code rearrangement
Matthias Clasen [Sat, 24 May 2014 01:41:58 +0000 (21:41 -0400)]
Trivial: slight code rearrangement

11 years agotests: Stop using GtkAlignment
Matthias Clasen [Sat, 24 May 2014 00:42:47 +0000 (20:42 -0400)]
tests: Stop using GtkAlignment

Fix up all other tests to not use GtkAlignment anymore.

11 years agotestadjustsize: Keep using an alignment
Matthias Clasen [Sat, 24 May 2014 00:42:01 +0000 (20:42 -0400)]
testadjustsize: Keep using an alignment

We are explicitly comparing GtkAlignment with its replacements
here.

11 years agogtk-demo: Drop use of GtkAlignment
Matthias Clasen [Wed, 14 May 2014 03:18:17 +0000 (23:18 -0400)]
gtk-demo: Drop use of GtkAlignment

11 years agoDeprecate GtkAligment
Matthias Clasen [Sat, 24 May 2014 00:09:08 +0000 (20:09 -0400)]
Deprecate GtkAligment

This has been dangling ever since 3.0.

https://bugzilla.gnome.org/show_bug.cgi?id=645781

11 years agoDrop an unneeded include
Matthias Clasen [Sat, 24 May 2014 00:04:36 +0000 (20:04 -0400)]
Drop an unneeded include

There's no GtkGesture in gtkwidget.h anymore. We do need an include
in gtkwidgetprivate.h though.

11 years agoa11y: build directly into libgtk instead of an internal library
Evan Nemerson [Fri, 23 May 2014 04:09:59 +0000 (21:09 -0700)]
a11y: build directly into libgtk instead of an internal library

https://bugzilla.gnome.org/show_bug.cgi?id=730615

11 years agoMore updates
Matthias Clasen [Fri, 23 May 2014 21:32:14 +0000 (17:32 -0400)]
More updates

11 years agoSome updates
Matthias Clasen [Fri, 23 May 2014 20:11:48 +0000 (16:11 -0400)]
Some updates

11 years agoUpdated POTFILES.in
Piotr Drąg [Fri, 23 May 2014 18:48:12 +0000 (20:48 +0200)]
Updated POTFILES.in

11 years agoMerge branch 'gestures'
Carlos Garnacho [Fri, 23 May 2014 17:58:46 +0000 (19:58 +0200)]
Merge branch 'gestures'

11 years agospinbutton: Avoid touch text handles to pop up
Carlos Garnacho [Thu, 22 May 2014 14:04:03 +0000 (16:04 +0200)]
spinbutton: Avoid touch text handles to pop up

Those get in the middle more than help on these widgets, the widget
is already packed with clickable areas and having handles (and their
invisible clickable area around) hovering above don't help, plus the
purpose in most likely numeric values is a bit doubtful.

All touch events are either consumed by the up/down panels, or
the swipe gesture, all GtkEntry handling of touch events on the text
window is avoided, so handles to not appear anymore.

11 years agocolorswatch: Set gestures in GTK_PHASE_TARGET
Carlos Garnacho [Thu, 22 May 2014 13:39:31 +0000 (15:39 +0200)]
colorswatch: Set gestures in GTK_PHASE_TARGET

That's the right phase for gestures replacing entirely event handlers.

11 years agospinbutton: Use GTK_PHASE_CAPTURE for touch swipes
Carlos Garnacho [Thu, 22 May 2014 13:36:32 +0000 (15:36 +0200)]
spinbutton: Use GTK_PHASE_CAPTURE for touch swipes

The gesture must be able to catch first events for it to be seen
as recognized in event handlers.

11 years agowidget: Flip execution order of GTK_PHASE_TARGET/BUBBLE
Carlos Garnacho [Thu, 22 May 2014 13:24:28 +0000 (15:24 +0200)]
widget: Flip execution order of GTK_PHASE_TARGET/BUBBLE

the "bubble" phase used to run before event handlers before GTK_PHASE_TARGET
was added, in order to keep phases in the expected order, move GTK_PHASE_BUBBLE
to be run (still invariably) after event handlers.

The only behavioral change should be wrt widgets wanting mixed event handler/
gesture handling, they could previously attach the gesture to the bubble phase
and check for gtk_gesture_is_active() in the event handler to bail out, they'll
have to use GTK_PHASE_CAPTURE for that purpose from now on.

11 years agotexthandle: Mind the invisible area when moving the handle
Carlos Garnacho [Wed, 21 May 2014 12:58:50 +0000 (14:58 +0200)]
texthandle: Mind the invisible area when moving the handle

The handle is still centered horizontally, but the extra vertical
space wasn't taken into account, leading to misplacing the dragging
point (and the handle) during motion events.

11 years agotextview: Check first whether the sequence is handled, fetch later the event
Carlos Garnacho [Wed, 21 May 2014 12:57:07 +0000 (14:57 +0200)]
textview: Check first whether the sequence is handled, fetch later the event

And always unset/hide the selection popover if unhandled, that means the
sequence went grabbed/claimed somewhere else and cancelled here.

11 years agoentry: Check first whether the sequence is handled, fetch later the event
Carlos Garnacho [Wed, 21 May 2014 12:51:46 +0000 (14:51 +0200)]
entry: Check first whether the sequence is handled, fetch later the event

And always unset/hide the selection popover if unhandled, that means the
sequence went grabbed/claimed somewhere else and cancelled here.

11 years agogesture: Use GdkEventSequence GType in signals
Carlos Garnacho [Tue, 20 May 2014 12:10:31 +0000 (14:10 +0200)]
gesture: Use GdkEventSequence GType in signals

11 years agogesture: Introspection fixes
Carlos Garnacho [Tue, 20 May 2014 12:09:40 +0000 (14:09 +0200)]
gesture: Introspection fixes

Set annotations on return values for gtk_gesture_get_device() and
gtk_gesture_get_window().

11 years agoeventcontroller: introspection fix
Carlos Garnacho [Tue, 20 May 2014 12:08:27 +0000 (14:08 +0200)]
eventcontroller: introspection fix

Set transfer annotation on gtk_event_controller_get_widget()

11 years agogdk: Make GdkEventSequence a boxed type
Carlos Garnacho [Tue, 20 May 2014 12:07:16 +0000 (14:07 +0200)]
gdk: Make GdkEventSequence a boxed type

Not much to copy nor free, but this'll make bindings happy

11 years agopaned: Handle pointer events from touchscreen devices
Carlos Garnacho [Mon, 19 May 2014 21:02:49 +0000 (23:02 +0200)]
paned: Handle pointer events from touchscreen devices

GtkPaned may just capture pointer events because the child widget
doesn't happen to have GDK_TOUCH_MASK set, resort to checking the
device in that case.

11 years agoDocs: Cosmetic fixes
Matthias Clasen [Tue, 20 May 2014 02:16:03 +0000 (22:16 -0400)]
Docs: Cosmetic fixes

11 years agodocs: Correct a reference
Matthias Clasen [Tue, 20 May 2014 01:46:30 +0000 (21:46 -0400)]
docs: Correct a reference

11 years agoRevert "docs: GtkEventController was dropped from public api"
Matthias Clasen [Tue, 20 May 2014 01:41:35 +0000 (21:41 -0400)]
Revert "docs: GtkEventController was dropped from public api"

This reverts commit eefac03b395a6b885fd61c100b48652200beb996.

11 years agoRevert "docs: More GtkEventController removal"
Matthias Clasen [Tue, 20 May 2014 01:41:21 +0000 (21:41 -0400)]
Revert "docs: More GtkEventController removal"

This reverts commit 75f503fb1fc9068c9e1a0d02126c55addbe8eb3e.

11 years agoDocs: Add information about event propagation
Matthias Clasen [Tue, 20 May 2014 01:24:46 +0000 (21:24 -0400)]
Docs: Add information about event propagation

11 years agoDocs: Minor changes
Matthias Clasen [Tue, 20 May 2014 00:45:42 +0000 (20:45 -0400)]
Docs: Minor changes

11 years agoDocument gtk_gesture_set_state
Matthias Clasen [Tue, 20 May 2014 00:17:12 +0000 (20:17 -0400)]
Document gtk_gesture_set_state

11 years agodocs: gtk_gesture_cancel_sequence was made private
Matthias Clasen [Tue, 20 May 2014 00:10:48 +0000 (20:10 -0400)]
docs: gtk_gesture_cancel_sequence was made private

11 years agodocs: More GtkEventController removal
Matthias Clasen [Tue, 20 May 2014 00:00:31 +0000 (20:00 -0400)]
docs: More GtkEventController removal

11 years agodocs: GtkEventController was dropped from public api
Matthias Clasen [Mon, 19 May 2014 23:37:16 +0000 (19:37 -0400)]
docs: GtkEventController was dropped from public api

11 years agopaned: Use GtkGesture to handle handle dragging
Carlos Garnacho [Mon, 19 May 2014 17:58:54 +0000 (19:58 +0200)]
paned: Use GtkGesture to handle handle dragging

Dragging is all handled by a GtkGesturePan now, matching the
paned orientation.

On touch events, a wider area is listened for, so touch events
don't need to be as accurate to initiate dragging, if no dragging
is truly initiated in this case, events are just forwarded for
child widgets to handle.

11 years agoswitch: Use GtkGesture to handle input events
Carlos Garnacho [Mon, 19 May 2014 14:08:56 +0000 (16:08 +0200)]
switch: Use GtkGesture to handle input events

A pan gesture is used to handle switch dragging, which is only triggered
by horizontal panning movements. A multipress gesture handles the cases
where clicking without dragging happens, just toggling the switch.

11 years agoinspector: Add more complete gesture support
Matthias Clasen [Fri, 16 May 2014 23:44:43 +0000 (19:44 -0400)]
inspector: Add more complete gesture support

Add a dedicated tab that shows how gestures are grouped,
and allows changing the propagation phase.

11 years agoinspector: Minimal support for gestures
Matthias Clasen [Fri, 16 May 2014 18:27:58 +0000 (14:27 -0400)]
inspector: Minimal support for gestures

We're just showing them as objects in the tree, for now.

11 years agoAdd back a private api to list controllers
Matthias Clasen [Fri, 16 May 2014 17:14:13 +0000 (13:14 -0400)]
Add back a private api to list controllers

This will let us show them in the inspector.

11 years agotexthandle: Make a bigger hit area around texthandles
Carlos Garnacho [Fri, 16 May 2014 17:59:31 +0000 (19:59 +0200)]
texthandle: Make a bigger hit area around texthandles

The hit area now extends to all sides around the handle, instead
of just towards where the text is. This makes it easier to grab
handles once shown.

11 years agogesture: Declare GtkGesture:window as an object property
Carlos Garnacho [Fri, 16 May 2014 17:35:08 +0000 (19:35 +0200)]
gesture: Declare GtkGesture:window as an object property

11 years agowidget: 3-way merge ate my g_object_ref()
Carlos Garnacho [Fri, 16 May 2014 16:58:11 +0000 (18:58 +0200)]
widget: 3-way merge ate my g_object_ref()

Move it to the right place.

11 years agoscrolledwindow: Handle directional cancellation if there is a single scroll direction
Carlos Garnacho [Fri, 16 May 2014 16:35:45 +0000 (18:35 +0200)]
scrolledwindow: Handle directional cancellation if there is a single scroll direction

A pan gesture is optionally attached if there is only one scrolling direction, the pan
gesture orientation is changed so movements tangential to the scroll direction get
scrolling cancelled (The pan gesture is automatically denied when that happens, and
that state change spreads to the others gestures in the group). If the pan direction
happens in the expected directions, no cancellation happens, and scrolling eventually
takes place.

11 years agowidget: remove check on whether the controller was already added
Carlos Garnacho [Fri, 16 May 2014 16:34:15 +0000 (18:34 +0200)]
widget: remove check on whether the controller was already added

Multiple calls are supposedly allowed to change the phase (although
unlikely to happen), so remove the g_return_if_fail() checking whether
the controller was already added.

11 years agopan: Remove wrong check
Carlos Garnacho [Fri, 16 May 2014 16:33:05 +0000 (18:33 +0200)]
pan: Remove wrong check

From the very early days where there were a NONE=0 GtkPanOrientation
value. This makes vertical pan operations work as expected.

11 years agoentry: Ensure the cursor text handle is shown after touching to reposition cursor.
Carlos Garnacho [Fri, 16 May 2014 15:46:12 +0000 (17:46 +0200)]
entry: Ensure the cursor text handle is shown after touching to reposition cursor.

11 years agopopover: Hide widget first when disposing
Carlos Garnacho [Fri, 16 May 2014 15:38:28 +0000 (17:38 +0200)]
popover: Hide widget first when disposing

In order to ensure invariants are kept.

11 years agoentry: Obey implementations' frame when placing handles/popovers around
Carlos Garnacho [Fri, 16 May 2014 15:36:59 +0000 (17:36 +0200)]
entry: Obey implementations' frame when placing handles/popovers around

Y=0 was assumed in a few places, not necessarily right on eg. vertical
spinbuttons.

11 years agoentry: Improve touch popover interaction
Carlos Garnacho [Fri, 16 May 2014 15:35:53 +0000 (17:35 +0200)]
entry: Improve touch popover interaction

Presses alternatively show and dismiss the popover, the popover is still
always shown invariably after any dragging happens (either text selection,
or dragging a text handle)

11 years agotextview: Show the magnifier popover a bit farther from the touch position
Carlos Garnacho [Fri, 16 May 2014 15:32:59 +0000 (17:32 +0200)]
textview: Show the magnifier popover a bit farther from the touch position

Somewhat arbitrary at the moment, would be nice to have minimal units
support for this, or at least hidpi support.

11 years agotextview: Improve touch popover interaction
Carlos Garnacho [Fri, 16 May 2014 15:27:42 +0000 (17:27 +0200)]
textview: Improve touch popover interaction

Presses alternatively show and dismiss the popover, the popover is still
always shown invariably after any dragging happens (either text selection,
or dragging a text handle)

11 years agoentry: Use gestures to handle pointer/touch events
Carlos Garnacho [Thu, 15 May 2014 13:03:18 +0000 (15:03 +0200)]
entry: Use gestures to handle pointer/touch events

Similarly to GtkTextView, a GtkGestureMultiPress gesture handles
button/touch presses to initiate one selection mode or other, and
a GtkGestureDrag is used to handle text selection and DnD checks.

The code from button press/release, motion, and grab_notify handlers
has been shuffled into the actions triggered by those gestures.

11 years agospinbutton: Attach "swipe to spin" controllers to the bubble phase
Carlos Garnacho [Wed, 14 May 2014 11:05:41 +0000 (13:05 +0200)]
spinbutton: Attach "swipe to spin" controllers to the bubble phase

It is unnecessary to have those process events manually, just attach
those to the bubble phase.

11 years agocolorplane: Fully port to GtkGesture
Carlos Garnacho [Wed, 14 May 2014 10:56:16 +0000 (12:56 +0200)]
colorplane: Fully port to GtkGesture

A GtkGestureDrag is used for color selection, removing also the
need to track the pointer state in widget data. The GDK grab performed
just to set the crosshair cursor has been replaced by a call
to gdk_window_set_device_cursor(), which will be unset if the
drag operation is finished, or cancelled due to the implicit grab
being broken.

11 years agogdk: Lookup both device and global cursor when checking up the hierarchy
Carlos Garnacho [Wed, 14 May 2014 10:53:54 +0000 (12:53 +0200)]
gdk: Lookup both device and global cursor when checking up the hierarchy

When the pointer cursor is updated on CSW, lookup for either a device
cursor, or a global one. It would previously lookup for windows with
a global cursor, and then check if it had a device cursor, which would
skip windows with only device cursors set, and unexpectedly set the
global cursor.

11 years agobutton: Make multipress gesture exclusive
Carlos Garnacho [Mon, 12 May 2014 17:52:35 +0000 (19:52 +0200)]
button: Make multipress gesture exclusive

We only want actions to be triggered by a single sequence there,
so buttons trigger no actions on further simultaneous touches
happening.

11 years agogesturesingle: Add an "exclusive" boolean property
Carlos Garnacho [Mon, 12 May 2014 17:50:26 +0000 (19:50 +0200)]
gesturesingle: Add an "exclusive" boolean property

All "exclusive" gestures listen for either pointer events, or
"pointer emulating" touch events, so only a single sequence at
a time can make these run.

11 years agobutton: Use GtkGestureMultiPress for signal emission
Carlos Garnacho [Mon, 12 May 2014 17:12:27 +0000 (19:12 +0200)]
button: Use GtkGestureMultiPress for signal emission

It is now useful for that purpose with a ::release signal, so replace
the custom GtkGestureSingle with one of these.

11 years agodrag: Allow gtk_gesture_get_start_point/offset() to be called on ::drag-end
Carlos Garnacho [Mon, 12 May 2014 17:11:53 +0000 (19:11 +0200)]
drag: Allow gtk_gesture_get_start_point/offset() to be called on ::drag-end

11 years agomultipress: Add matching ::released signal
Carlos Garnacho [Mon, 12 May 2014 15:02:03 +0000 (17:02 +0200)]
multipress: Add matching ::released signal

This signal will always be paired with a ::pressed signal, unless
the sequence is cancelled, or the controller is reset. the n_press
argument in the signal always matches the ::press signal one, even
if GtkGestureMultiPress::stopped was emitted in between.

11 years agomultipress: Protect against fleeting touches mistriggering events
Carlos Garnacho [Mon, 12 May 2014 14:56:41 +0000 (16:56 +0200)]
multipress: Protect against fleeting touches mistriggering events

The current sequence (as per gtk_gesture_single_get_current_sequence)
is used to find out the coordinates. And only emit ::pressed if the
gesture began through a GDK_BUTTON_PRESS/TOUCH_BEGIN (eg. not due to
an extra touch being lifted)

11 years agotextview: Set up controllers on the GTK_PHASE_TARGET propagation phase
Carlos Garnacho [Sat, 10 May 2014 18:59:55 +0000 (20:59 +0200)]
textview: Set up controllers on the GTK_PHASE_TARGET propagation phase

This way events are managed by gestures in the event handlers themselves,
respecting the execution order already assumed by subclasses around.

11 years agowidget: Hook GTK_PHASE_TARGET controllers to the default event handlers
Carlos Garnacho [Sat, 10 May 2014 18:52:17 +0000 (20:52 +0200)]
widget: Hook GTK_PHASE_TARGET controllers to the default event handlers

Just call the controllers on that phase if the default widget handlers
are run.

For compatibility reasons, in the touch event handler, let the pointer
emulating touch be transformed to a pointer event as usual, in order to
have widget handlers a chance to run at all. If they have to be managed
by a controller in that phase, it'll have to be through the default pointer
event handlers.

11 years agogesture: Add GTK_PHASE_TARGET
Carlos Garnacho [Sat, 10 May 2014 18:50:23 +0000 (20:50 +0200)]
gesture: Add GTK_PHASE_TARGET

This phase is meant to run in the default widget handlers, as opposed
to externally as in the bubble/capture phase. This will be most usually
the expected phase for every controller replacing code in event handlers
in GTK+, just so invocation and triggering order is kept unaltered.

11 years agogesture: Handle GdkEventGrabBroken
Carlos Garnacho [Sat, 10 May 2014 18:46:47 +0000 (20:46 +0200)]
gesture: Handle GdkEventGrabBroken

That may happen separately from grab-notify, and also due to external
reasons, so ensure all sequences are cancelled if a grab is taken
in some GdkWindows that would obscure events on the controller.

11 years agoGtkColorSwatch: Use gesture for button events too
Matthias Clasen [Fri, 9 May 2014 23:24:27 +0000 (19:24 -0400)]
GtkColorSwatch: Use gesture for button events too

11 years agoGtkWindow: Only use a multipress gesture for toplevels
Matthias Clasen [Fri, 9 May 2014 22:55:48 +0000 (18:55 -0400)]
GtkWindow: Only use a multipress gesture for toplevels

There is no point in creating and attaching this gesture
for override-redirect windows, so don't do it.

11 years agoBe careful about the list of event controllers
Matthias Clasen [Fri, 9 May 2014 19:53:27 +0000 (15:53 -0400)]
Be careful about the list of event controllers

We can end up with _gtk_widget_remove_controller getting called
while we are iterating over the list in _gtk_widget_run_controllers.
To avoid trouble, only mark the event controller as dead by
setting data->controller to NULL, and defer the actual freeing
and list manipulation to the loop in _gtk_widget_run_controllers.
Update other places that operate on controllers to handle
data->controller being NULL.

11 years agotextview: Convert gestures' coordinates to text window ones
Carlos Garnacho [Fri, 9 May 2014 11:19:12 +0000 (13:19 +0200)]
textview: Convert gestures' coordinates to text window ones

And make some code shared between multipress/drag gesture.

11 years agotextview: Use GtkGestureDrag for text selection/DnD
Carlos Garnacho [Thu, 8 May 2014 14:28:49 +0000 (16:28 +0200)]
textview: Use GtkGestureDrag for text selection/DnD

remaining code in button press/release, motion notify, and grab
notify handlers has been shuffled to be managed by this gesture.

11 years agotextview: Use GtkGestureMultiPress for click handling
Carlos Garnacho [Wed, 7 May 2014 11:15:30 +0000 (13:15 +0200)]
textview: Use GtkGestureMultiPress for click handling

The button press handler is no longer necessary, and most of its
code has been shuffled into the GtkGestureMultiPress::pressed
handler.

11 years agowidget: tighten the conditions at which a press event is emulated
Carlos Garnacho [Wed, 7 May 2014 17:08:50 +0000 (19:08 +0200)]
widget: tighten the conditions at which a press event is emulated

Make it really sure that the event is only emitted after every gesture
that consumed the button press is done with the sequence.
The event must only be emulated if a gesture in the capture phase happened
to consume the event, be cancelled, and

11 years agowidget: Fix gesture event handler retval for bubbled events
Carlos Garnacho [Wed, 7 May 2014 17:06:42 +0000 (19:06 +0200)]
widget: Fix gesture event handler retval for bubbled events

Do not clobber the return value if the regular event handler happens
to return FALSE, even if the gesture meant to consume the event.

11 years agogesture: Prevent against sequence cancellation within gtk_gesture_set_state()
Carlos Garnacho [Wed, 7 May 2014 09:18:00 +0000 (11:18 +0200)]
gesture: Prevent against sequence cancellation within gtk_gesture_set_state()

Sequences may be cancelled within the ::sequence-state-changed handler, which
would change the points hashtable as it's being iterated in this function. So
iterate over a list of sequences and let the hashtable change freely.

11 years agogesture: Make gtk_gesture_get_last_update_time() private
Carlos Garnacho [Tue, 6 May 2014 16:22:57 +0000 (18:22 +0200)]
gesture: Make gtk_gesture_get_last_update_time() private

11 years agogesture: Remove gtk_gesture_get_last_event_type
Carlos Garnacho [Tue, 6 May 2014 16:18:10 +0000 (18:18 +0200)]
gesture: Remove gtk_gesture_get_last_event_type

11 years agogesture: make gtk_gesture_cancel_sequence() private
Carlos Garnacho [Tue, 6 May 2014 16:10:32 +0000 (18:10 +0200)]
gesture: make gtk_gesture_cancel_sequence() private

11 years agogesture: Make gtk_gesture_check() private
Carlos Garnacho [Tue, 6 May 2014 16:04:25 +0000 (18:04 +0200)]
gesture: Make gtk_gesture_check() private

11 years agodnd: Check on the right gesture sequence when starting the drag op
Carlos Garnacho [Tue, 6 May 2014 15:27:17 +0000 (17:27 +0200)]
dnd: Check on the right gesture sequence when starting the drag op

11 years agogesture: Simplify gesture/widget interaction public API
Carlos Garnacho [Tue, 6 May 2014 13:50:01 +0000 (15:50 +0200)]
gesture: Simplify gesture/widget interaction public API

The propagation phase property/methods in GtkEventController are gone,
This is now set directly on the GtkWidget add/remove controller API,
which has been made private.

The only public bit now are the new functions gtk_gesture_attach() and
gtk_gesture_detach() that will use the private API underneath.

All callers have been updated.

11 years agowidget: Keep a widget reference around _gtk_widget_run_controllers()
Carlos Garnacho [Tue, 6 May 2014 13:25:31 +0000 (15:25 +0200)]
widget: Keep a widget reference around _gtk_widget_run_controllers()

The widget may be destroyed within the loop, in reaction to the signals
sent by the controllers. Protect against that.

11 years agogesture: Add explanatory note in GtkGesture::end
Carlos Garnacho [Tue, 6 May 2014 13:23:24 +0000 (15:23 +0200)]
gesture: Add explanatory note in GtkGesture::end

Explain that this signal may be triggered by an extra touch that causes
the gesture to surpass GtkGesture:n-points.

11 years agogesture: Cancel sequences that make a gesture exceed the number of touches as they...
Carlos Garnacho [Tue, 6 May 2014 13:20:56 +0000 (15:20 +0200)]
gesture: Cancel sequences that make a gesture exceed the number of touches as they happen

This makes it possible to track those through gtk_gesture_handles_sequence(),
without guessing from last event type or sequence state.

11 years agowidget: Change slightly the gesture cancellation policy in a same widget
Carlos Garnacho [Tue, 6 May 2014 12:12:13 +0000 (14:12 +0200)]
widget: Change slightly the gesture cancellation policy in a same widget

Within a widget, if a gesture accepts a sequence, it would previously
cancel every other gesture that not in the same group. Change this to
only cancelling gestures that previously claimed the gesture, and let
gestures with state=NONE for that sequence remain like that.

This enables late recognition of gestures, even on the presence of
another gesture group that was more eager at claiming the gesture.

One usecase is user-defined panning gestures on scrolledwindows,
if ::capture-button-press is TRUE (eg. the default), the gesture is
claimed early in order to consume the button press, but that would
tipically make every other gesture group deny the sequence. With
this change, the pan gesture can keep state=NONE, and later claim
the sequence for itself if the panning gesture is recognized.

Also, do not propagate state=DENIED to every gesture in the widget,
that was unintended.

11 years agorotate: Ensure delta is between [0..2π]
Carlos Garnacho [Tue, 6 May 2014 09:43:31 +0000 (11:43 +0200)]
rotate: Ensure delta is between [0..2π]

11 years agopan: make the direction factor less narrow in v/h directions
Carlos Garnacho [Tue, 6 May 2014 09:39:15 +0000 (11:39 +0200)]
pan: make the direction factor less narrow in v/h directions

11 years agogesture: Handle GDK_TOUCH_CANCEL events
Carlos Garnacho [Mon, 5 May 2014 12:21:36 +0000 (14:21 +0200)]
gesture: Handle GDK_TOUCH_CANCEL events

The wayland windowing backend emits such events for instance, so
have gestures cancel the sequence as those events get through.

11 years agogesture: Protect against odd window hierarchies
Carlos Garnacho [Mon, 28 Apr 2014 10:53:36 +0000 (12:53 +0200)]
gesture: Protect against odd window hierarchies

If no match is found with the gesture widget when poking the event
window parents, bail out safely instead of falling in an infinite
loop. This was seen on Mutter.

11 years agoswipe: Don't emit ::swipe if there are still active touches
Carlos Garnacho [Thu, 17 Apr 2014 11:05:11 +0000 (13:05 +0200)]
swipe: Don't emit ::swipe if there are still active touches

Avoids sending spurious signals when an extra touch happens.

11 years agoPrevent subclassing of gestures
Matthias Clasen [Tue, 6 May 2014 02:40:18 +0000 (22:40 -0400)]
Prevent subclassing of gestures

For now, at least. We do this by hiding the instance and
class structures in private headers.

11 years agoGtkSpinButton: Don't leak the gestures
Matthias Clasen [Fri, 2 May 2014 02:05:42 +0000 (22:05 -0400)]
GtkSpinButton: Don't leak the gestures

11 years agoGtkWindow: Don't leak the gesture
Matthias Clasen [Fri, 2 May 2014 02:00:01 +0000 (22:00 -0400)]
GtkWindow: Don't leak the gesture

11 years agoGtkTreeView: Remove unused field
Matthias Clasen [Fri, 2 May 2014 01:53:35 +0000 (21:53 -0400)]
GtkTreeView: Remove unused field

11 years agogtk3-demo: Don't leak the color chooser
Matthias Clasen [Fri, 2 May 2014 01:01:33 +0000 (21:01 -0400)]
gtk3-demo: Don't leak the color chooser